@extends('layouts.app')
@section('style')
    @parent
@endsection
@section('content')
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <form class="form-inline" role="form" action="{{action('LogController@deleteLog')}}" method="post">
                        {{csrf_field()}}
                        <div class="form-group">
                            <label for="name">ID</label>
                            <input type="text" class="form-control" id="id" placeholder="id" name="id">
                        </div>
                        <button type="submit" class="btn btn-default">提交</button>
                    </form>
                </div>
                <div class="panel-body">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户ID</th>
                            <th>用户名</th>
                            <th>时间</th>
                            <th>操作行为</th>
                        </tr>
                        </thead>
                        <tbody>
                        @if(!empty($log))
                            @forelse($log as $val)
                                <tr>
                                    <td>{{$val->id}}</td>
                                    <td>{{$val->user_id}}</td>
                                    <td>{{$val->user_name}}</td>
                                    <td>{{$val->time}}</td>
                                    <td>{{$val->opration}}</td>
                                </tr>
                            @empty
                                null
                            @endforelse
                        @endif
                        </tbody>
                    </table>
                </div>
            </div>
            {{$log->links()}}
        </div>
    </div>
@endsection
@section('script')
    @parent
@endsection
